package com.alibaba.aone.casestudy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.aone.casestudy.common.entity.Failure;

import com.alibaba.aone.casestudy.common.entity.FailureConditions;
import com.alibaba.aone.casestudy.common.entity.FailureRpAsignGroup;
import com.alibaba.aone.casestudy.dao.FailureDao;
import com.alibaba.aone.casestudy.dao.FailureRpAsignGroupDao;
import com.alibaba.aone.casestudy.dao.FailureTimeDao;
import com.alibaba.aone.casestudy.service.FailureService;

public class FailureServiceImpl implements FailureService {
	@Autowired
	private FailureDao failureDao;
	@Autowired
	private FailureTimeDao failureTimeDao;
	@Autowired
	private FailureRpAsignGroupDao groupDao;

	public Failure getFailureByNumber(String number) {

		return failureDao.getFailureByNumber(number);
	}

	public List<Failure> selectFailure(
			FailureConditions failureConditions) {
		
		return failureDao.selectFailure(failureConditions);
	}

	public void updateFailure(Failure failure) {
		failureDao.update(failure);
		
	}

	public void addFailure(Failure failure) {
		failureDao.add(failure);
		
	}

	public List<Failure> getAllFailures() {
		
		return failureDao.getAllFailures();
	}

	public int setFailureNumber() {
		
		return failureDao.setFailureNumber();
	}

	public void delete(String number) {
		failureDao.delete(number);
		failureTimeDao.delete(number);
		groupDao.delete(number);
		
		
	}

	
}
